<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>latex常用代码 | 月藤的博客</title>
    <meta name="generator" content="VuePress 1.8.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css">
    <meta name="description" content="简单的介绍">
    
    <link rel="preload" href="/assets/css/0.styles.a2e941e0.css" as="style"><link rel="preload" href="/assets/js/app.54ea76a2.js" as="script"><link rel="preload" href="/assets/js/2.c554ece5.js" as="script"><link rel="preload" href="/assets/js/9.8def3992.js" as="script"><link rel="prefetch" href="/assets/js/10.95d63e51.js"><link rel="prefetch" href="/assets/js/11.26e082be.js"><link rel="prefetch" href="/assets/js/12.1f62021c.js"><link rel="prefetch" href="/assets/js/13.9096527c.js"><link rel="prefetch" href="/assets/js/14.86142c70.js"><link rel="prefetch" href="/assets/js/15.1adeebc5.js"><link rel="prefetch" href="/assets/js/16.efcc79e4.js"><link rel="prefetch" href="/assets/js/17.74da5698.js"><link rel="prefetch" href="/assets/js/18.fd808b3a.js"><link rel="prefetch" href="/assets/js/19.8dafe26f.js"><link rel="prefetch" href="/assets/js/20.aed54ab4.js"><link rel="prefetch" href="/assets/js/21.341a5670.js"><link rel="prefetch" href="/assets/js/22.ab8b375c.js"><link rel="prefetch" href="/assets/js/23.28489470.js"><link rel="prefetch" href="/assets/js/24.87aae001.js"><link rel="prefetch" href="/assets/js/25.211ca3bf.js"><link rel="prefetch" href="/assets/js/26.afa4c8f0.js"><link rel="prefetch" href="/assets/js/27.9b98f6f3.js"><link rel="prefetch" href="/assets/js/28.93298733.js"><link rel="prefetch" href="/assets/js/29.e8c038c4.js"><link rel="prefetch" href="/assets/js/3.9d562ae1.js"><link rel="prefetch" href="/assets/js/30.27939f01.js"><link rel="prefetch" href="/assets/js/31.6a9774e8.js"><link rel="prefetch" href="/assets/js/32.f698e967.js"><link rel="prefetch" href="/assets/js/33.5ba4bfb8.js"><link rel="prefetch" href="/assets/js/34.dca90861.js"><link rel="prefetch" href="/assets/js/35.768c1bb2.js"><link rel="prefetch" href="/assets/js/36.6b0a867f.js"><link rel="prefetch" href="/assets/js/37.61156e90.js"><link rel="prefetch" href="/assets/js/38.e390246c.js"><link rel="prefetch" href="/assets/js/39.0fbd0dd1.js"><link rel="prefetch" href="/assets/js/4.e18bc6a8.js"><link rel="prefetch" href="/assets/js/40.4252699c.js"><link rel="prefetch" href="/assets/js/41.2e5b5840.js"><link rel="prefetch" href="/assets/js/42.8fe886c7.js"><link rel="prefetch" href="/assets/js/43.7a4b0851.js"><link rel="prefetch" href="/assets/js/44.93c2313d.js"><link rel="prefetch" href="/assets/js/45.33dcea60.js"><link rel="prefetch" href="/assets/js/46.681fdf10.js"><link rel="prefetch" href="/assets/js/47.a842a141.js"><link rel="prefetch" href="/assets/js/48.9a03ba74.js"><link rel="prefetch" href="/assets/js/49.a50266b1.js"><link rel="prefetch" href="/assets/js/5.dc6a2d8c.js"><link rel="prefetch" href="/assets/js/50.f2a42406.js"><link rel="prefetch" href="/assets/js/51.444cc3d8.js"><link rel="prefetch" href="/assets/js/52.cf2befd8.js"><link rel="prefetch" href="/assets/js/53.fbe609f8.js"><link rel="prefetch" href="/assets/js/54.a43fb514.js"><link rel="prefetch" href="/assets/js/55.d0c11641.js"><link rel="prefetch" href="/assets/js/56.c6f114d9.js"><link rel="prefetch" href="/assets/js/57.cc386420.js"><link rel="prefetch" href="/assets/js/58.e747d0f6.js"><link rel="prefetch" href="/assets/js/6.c1fd48f0.js"><link rel="prefetch" href="/assets/js/7.32b39b92.js"><link rel="prefetch" href="/assets/js/8.e2284671.js">
    <link rel="stylesheet" href="/assets/css/0.styles.a2e941e0.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">月藤的博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://ziphold.gitee.io/blog/#/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  旧博客（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://rattonlzh.github.io/homepage/homepage.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  常用网址导航（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Select language" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/知识点总结/latex总结.html" class="nav-link">
  zh-CN
</a></li><li class="dropdown-item"><!----> <a href="/en/" class="nav-link">
  en-US
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><div class="avatar"><img src="/assets/img/avatar.2b77755b.png" alt srcset></div> <div style="z-index: 999"><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="298" height="52" src="//music.163.com/outchain/player?type=2&id=28283137&auto=1&height=32"></iframe></div> <nav class="nav-links"><div class="nav-item"><a href="https://ziphold.gitee.io/blog/#/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  旧博客（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://rattonlzh.github.io/homepage/homepage.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  常用网址导航（停止更新）
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Select language" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/知识点总结/latex总结.html" class="nav-link">
  zh-CN
</a></li><li class="dropdown-item"><!----> <a href="/en/" class="nav-link">
  en-US
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>随便说说</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>知识点总结</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/知识点总结/git总结.html" class="sidebar-link">git总结</a></li><li><a href="/知识点总结/java单元测试总结.html" class="sidebar-link">java测试</a></li><li><a href="/知识点总结/jquery总结.html" class="sidebar-link">jquery初探</a></li><li><a href="/知识点总结/js总结.html" class="sidebar-link">js易错点</a></li><li><a href="/知识点总结/kotlin语法总结.html" class="sidebar-link">kotlin语法入门</a></li><li><a href="/知识点总结/latex总结.html" class="active sidebar-link">latex常用代码</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#使用前配置" class="sidebar-link">使用前配置</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#第一行代码" class="sidebar-link">第一行代码</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#必要的关键字" class="sidebar-link">必要的关键字</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#选定一个latex模板" class="sidebar-link">选定一个latex模板</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#工具" class="sidebar-link">工具</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#自定义texstudio设置" class="sidebar-link">自定义TeXstudio设置</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#修改默认的编译器" class="sidebar-link">修改默认的编译器</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#自定义快捷键" class="sidebar-link">自定义快捷键</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#迷惑error的处理" class="sidebar-link">迷惑error的处理</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#多文件写作" class="sidebar-link">多文件写作</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#利用bib文件引用文献" class="sidebar-link">利用bib文件引用文献</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#常用快捷键" class="sidebar-link">常用快捷键</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#打印空格和新行" class="sidebar-link">打印空格和新行</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#数学公式环境" class="sidebar-link">数学公式环境</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#插入图片" class="sidebar-link">插入图片</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#插入表格" class="sidebar-link">插入表格</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#设置中文显示" class="sidebar-link">设置中文显示</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#代码插入" class="sidebar-link">代码插入</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#辅助工具" class="sidebar-link">辅助工具</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#资深玩家专区" class="sidebar-link">资深玩家专区</a></li><li class="sidebar-sub-header"><a href="/知识点总结/latex总结.html#参考资料" class="sidebar-link">参考资料</a></li></ul></li><li><a href="/知识点总结/PS总结.html" class="sidebar-link">PS总结</a></li><li><a href="/知识点总结/springboot总结.html" class="sidebar-link">springboot进行web开发总结</a></li><li><a href="/知识点总结/thinkphp总结.html" class="sidebar-link">thinkphp入坑</a></li><li><a href="/知识点总结/uml软件建模总结.html" class="sidebar-link">uml软件建模总结</a></li><li><a href="/知识点总结/人工智能总结.html" class="sidebar-link">人工智能总结</a></li><li><a href="/知识点总结/大数据软件工程总结.html" class="sidebar-link">大数据软件工程总结</a></li><li><a href="/知识点总结/常用快捷键总结.html" class="sidebar-link">第一篇博客</a></li><li><a href="/知识点总结/数字图像处理总结.html" class="sidebar-link">数字图像处理知识点</a></li><li><a href="/知识点总结/数据库应用理论总结.html" class="sidebar-link">数据库应用复习</a></li><li><a href="/知识点总结/数据库系统概念总结.html" class="sidebar-link">数据库系统概念总结</a></li><li><a href="/知识点总结/数据挖掘总结.html" class="sidebar-link">数据挖掘总结</a></li><li><a href="/知识点总结/设计模式总结.html" class="sidebar-link">设计模式</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>考研专区</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>读书笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发资料</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>配置记录</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>思维导图</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/friend_link.html" class="sidebar-link">友情链接</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="latex总结"><a href="#latex总结" class="header-anchor">#</a> latex总结</h1> <blockquote><p>pdfLaTeX是比较原始的版本，对Unicode的支持不是很好，所以显示汉字需要使用CJK宏包。它不支持操作系统的truetype字体(*.ttf)，只能使用type1字体。优点是支持的宏包比较多，有些老一点的宏包必须用pdfLaTeX来编译。XeLaTeX是新的Unicode版本，内建支持Unicode(UTF-8)，自然也包括汉字在内，而且可以调用操作系统的truetype字体。</p></blockquote> <h2 id="使用前配置"><a href="#使用前配置" class="header-anchor">#</a> 使用前配置</h2> <p>本文默认你在win10系统上安装了Mitex套件，现在打开Mitex自带的Latex编辑器TeXworks，将编译选项改为XeLatex+MakeIndex+BibTex
<img src="/assets/img/2019-08-11-13-06-02.f020e496.png" alt="无法正常显示"></p> <h2 id="第一行代码"><a href="#第一行代码" class="header-anchor">#</a> 第一行代码</h2> <div class="language-tex extra-class"><pre class="language-tex"><code><span class="token comment">% 正常的显示中文，仍需要ctex宏包 即 ctexart（ctex article）</span>
<span class="token function selector">\documentclass</span><span class="token punctuation">{</span><span class="token keyword">ctexart</span><span class="token punctuation">}</span>
<span class="token comment">% begin和end要成对出现</span>
<span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">document</span><span class="token punctuation">}</span>
hello, world!
<span class="token function selector">\section</span><span class="token punctuation">{</span><span class="token headline class-name">一级标题</span><span class="token punctuation">}</span>
<span class="token function selector">\subsection</span><span class="token punctuation">{</span><span class="token headline class-name">二级标题</span><span class="token punctuation">}</span>
<span class="token function selector">\subsubsection</span><span class="token punctuation">{</span><span class="token headline class-name">三级标题</span><span class="token punctuation">}</span>
<span class="token function selector">\paragraph</span><span class="token punctuation">{</span><span class="token headline class-name">定格段落</span><span class="token punctuation">}</span>
<span class="token function selector">\subparagraph</span><span class="token punctuation">{</span><span class="token headline class-name">空两格段落</span><span class="token punctuation">}</span>
<span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">document</span><span class="token punctuation">}</span>
<span class="token comment">% ctrl+T编译生成pdf文档在当前目录下</span>

</code></pre></div><h2 id="必要的关键字"><a href="#必要的关键字" class="header-anchor">#</a> 必要的关键字</h2> <p>文档类声明：<code>\documentclass{ctexart}</code>
文档内容：<code>\begin{document}...\end{document}</code>
数学宏包：<code>\usepackage{amsmath}</code></p> <h2 id="选定一个latex模板"><a href="#选定一个latex模板" class="header-anchor">#</a> 选定一个latex模板</h2> <p>一般使用latex写论文时不会自己从头调整排版样式，而是使用刊物提供的latex模板。本文将以Lecture Notes in Computer Science (LNCS)的latex模板为例。</p> <p>lncs的tex模板可以从<a href="https://www.springer.com/cn/computer-science/lncs/conference-proceedings-guidelines" target="_blank" rel="noopener noreferrer">springer官网<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>下载，springer同时把模板上传到了overleaf，用户也可以注册后直接使用<a href="https://www.overleaf.com/latex/templates/springer-lecture-notes-in-computer-science/kzwwpvhwnvfj#.WtR5Hy5ua71" target="_blank" rel="noopener noreferrer">overleaf<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>在线编辑</p> <p>本文以在本地使用<a href="http://texstudio.sourceforge.net/" target="_blank" rel="noopener noreferrer">TeXstudio<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>编辑器编写科技论文为例展开说明。如果你发现有些命令本该导入宏包我却没导入，那可能是我用的这个模板已经提前导入了这个宏包</p> <p>lncs的tex模板解压后的的重要文件目录结构如下：</p> <div class="language- extra-class"><pre class="language-text"><code>llncs2e
 ├─llncs.cls 样式文件，定义整个论文的排版格式和自定义命令
 ├─splncs04.bst 论文的参考文献格式文件，定义参考文献的书写格式
 └─。。。其他不重要
</code></pre></div><h2 id="工具"><a href="#工具" class="header-anchor">#</a> 工具</h2> <ul><li>OS: win 10</li> <li>latex环境：Miktex，只要把 <code>安装目录\miktex\bin\x64</code> 添加到环境变量path中，TeXstudio即可正确调用需要的latex编译命令</li> <li>编辑器：TeXstudio（专为latex设计的编辑器，对比自带的texworks，vscode的latex workshop，eclipse的texlipse，目前这个编辑体验最佳，但打开模板）</li></ul> <h2 id="自定义texstudio设置"><a href="#自定义texstudio设置" class="header-anchor">#</a> 自定义TeXstudio设置</h2> <p><strong>设置TeXstudio界面中文显示和调整字号</strong></p> <p>打开TeXstudio -&gt; 按<kbd>alt+o</kbd> -&gt; 选择 <code>Configure TeXstudio</code> -&gt; <code>General</code> -&gt; <code>Language</code> -&gt; <code>zh_CN</code></p> <p>从这里开始,后面的设置都以中文界面为准</p> <p>打开TeXstudio -&gt; 按<kbd>alt+o</kbd> -&gt; 选择 <code>设置TeXstudio</code> -&gt; <code>常规</code></p> <p>字体设为 <code>微软雅黑</code>，字号 设为 12</p> <p><img src="/assets/img/image-20200622165532310.e661d2c5.png" alt="image-20200622165532310"></p> <p>至于代码区的字号可以通过<kbd>ctrl+鼠标滚轮</kbd>调整</p> <h2 id="修改默认的编译器"><a href="#修改默认的编译器" class="header-anchor">#</a> 修改默认的编译器</h2> <p>打开TeXstudio -&gt; 按<kbd>alt+o</kbd> -&gt; 选择 <code>设置TeXstudio</code> -&gt; <code>构建</code> -&gt; <code>默认编译器</code> -&gt; <code>XeLaTeX</code>（因为XeLaTeX对中文有良好的支持，如果你的论文完全不考虑中文的显示和排版，则不需要改这个）。设置了默认的编译器后，可以</p> <h2 id="自定义快捷键"><a href="#自定义快捷键" class="header-anchor">#</a> 自定义快捷键</h2> <p>为了提高写作效率，我会修改一些快捷键。</p> <p>打开TeXstudio -&gt; 按<kbd>alt+o</kbd> -&gt; 选择 <code>设置TeXstudio</code> -&gt; <code>快捷键</code></p> <ol><li><code>命令 -&gt; 章节</code>, 其中节，小节，子小节的快捷键依次设置为<kbd>ctrl+1</kbd>,<kbd>ctrl+2</kbd>,<kbd>ctrl+3</kbd>,这三个快捷键原来是绑定在书签上的，更改后可以用这三个快捷键设置一级标题h1，二级标题h2，三级标题h3</li> <li><code>表格操作-&gt;添加行</code>， <kbd>ctrl+alt+a</kbd></li> <li><code>向导-&gt;插入图片</code>, <kbd>ctrl+shift+i</kbd></li> <li><code>罗列环境-&gt;\item</code>, <kbd>ctrl+`</kbd></li> <li><code>Idefix-&gt;注释或取消注释</code>: <kbd>ctrl+/</kbd></li> <li><code>LaTex-&gt;\usepackage</code>：<kbd>ctrl+u</kbd>，注意宏包的使用声明必须在正文（<code>\begin{document}</code>）之前</li> <li><code>向导-&gt;插入表格</code>: <kbd>ctrl+t</kbd></li> <li><code>向导-&gt;插入图片</code>: <kbd>ctrl+shift+i</kbd></li> <li><code>向导-&gt;矩阵</code>:<kbd>ctrl+m</kbd></li> <li><code>LaTex-&gt;罗列环境-&gt;\item</code>: <kbd>ctrl+`</kbd></li> <li><code>帮助-&gt;LaTex引用...</code>:<kbd>ctrl+h</kbd></li> <li><code>编辑-&gt;行操作-&gt;上移行</code>:<kbd>alt+up</kbd></li> <li><code>编辑-&gt;行操作-&gt;下移行</code>:<kbd>alt+down</kbd></li> <li><code>编辑-&gt;行操作-&gt;复制行</code>:<kbd>alt+shift+down</kbd></li></ol> <h2 id="迷惑error的处理"><a href="#迷惑error的处理" class="header-anchor">#</a> 迷惑error的处理</h2> <p>编译tex文件会在同级目录下生成 <code>*.log,*.aux, *.bbl, *.blg, *.out,*.synctex.gz</code>之类的辅助文件,这些文件的存在可以加速你的再编译,同时可能导致你修改了正文某些内容(比如添加新宏包)后出现难以理解的bug。</p> <p>清理掉这些文件再编译可能会有所帮助</p> <h2 id="多文件写作"><a href="#多文件写作" class="header-anchor">#</a> 多文件写作</h2> <p>正文可以用一个tex文件编写,也可以按照章节划分成多个子文件分开编写。</p> <p>在正文里添加 <code>\include{subfilename(不需要后缀)}</code>，则会在编译时会把 main.tex同级目录下 <code>subfilename.tex</code>导入到 include位置后再进行渲染输出</p> <p>快捷创建子文件的小技巧：可以先在主文件里include了，再按住 <kbd>ctrl</kbd>点击被include的文件名，如果文件不存在，则会提醒你是否创建该文件，确定后在同级目录生成该文件的 <code>.tex</code>文件</p> <p>拆分成多文件来写作的使用场景一般是论文多人协作或写书</p> <h2 id="利用bib文件引用文献"><a href="#利用bib文件引用文献" class="header-anchor">#</a> 利用bib文件引用文献</h2> <p>在tex文件同级目录创建 <code>.bib</code>后缀的文件，习惯上以<code>ref.bib</code>命名。</p> <p>实际上一般不会直接手打bib内容，而是使用文件检索网站的导出功能，直接导出bib文件</p> <p>搜索参考文献可以使用百度学术，登录百度学术后搜索论文。对所有所需论文点击批量引用，点击右下角浮动按钮会出现一个引用文献列表，点击 <code>导出至</code>，选择 <code>BibTex(.bib)</code>直接生成bib文件</p> <p><img src="/assets/img/image-20200622171235475.11ad0773.png" alt="image-20200622171235475"></p> <p>也可以对单篇论文点击引用，弹出的对话框选择导入链接： <code>BibTeX</code></p> <img src="upload/image-20200622170814162.png" alt="image-20200622170814162" style="zoom:50%;"> <p>会返回bib格式的引文信息如下，把它粘贴到bib文件内即可</p> <p><img src="" alt="image-20200622105926459"></p> <p>大括号里的第一个字段<code>Hogenboom2016A</code>是你引用文献的ID，你可以随意修改这个名字（建议改短一点），只要保证在bib文件中的所有ID不出现重复即可。</p> <p><strong>引用文献的方法</strong>：在正文引用位置添加 <code>\cite{ID}</code>，</p> <p><strong>编译前正文中必要的操作</strong>：</p> <ul><li>指定文献格式：<code>\bibliographystyle{splncs04}</code>，splncs04是从springer下载的lncs latex模板自带的bst文件，规定了文献列表的格式</li> <li>指定bib文件：在要放置参考文献的位置添加 <code>\bibliography{ref}</code>。（<code>ref</code>是同级目录下的<code>.bib</code>文件的名字）。编译后参考文献列表在该位置生成</li></ul> <h2 id="常用快捷键"><a href="#常用快捷键" class="header-anchor">#</a> 常用快捷键</h2> <ul><li><kbd>ctrl+b</kbd> :加粗</li> <li><kbd>ctrl+i</kbd> :斜体</li> <li><kbd>ctrl+e</kbd> : 添加环境，即插入<code>\begin{name}content\end{name}</code>文本</li> <li><kbd>ctrl+shift+m</kbd>:插入行内数学公式</li> <li><kbd>ctrl+shift+n</kbd>:添加带自动标号的数学公式</li> <li><kbd>ctrl+k</kbd>:删除行</li> <li>需要在数学公式环境内使用的快捷键
<ul><li><kbd>ctrl+shift+d</kbd>:下标</li> <li><kbd>ctrl+shift+u</kbd>:上标</li> <li><kbd>ctrl+shift+f</kbd>:分数</li> <li><kbd>ctrl+shift+q</kbd>:根号</li> <li><kbd>ctrl+shift+l</kbd>:\left</li> <li><kbd>ctrl+shift+r</kbd>:\right</li></ul></li></ul> <h2 id="打印空格和新行"><a href="#打印空格和新行" class="header-anchor">#</a> 打印空格和新行</h2> <p>打印空格：<code>\quad</code></p> <p>打印新行，段落间存在一行以上的空行才会在输出结果中换行</p> <h2 id="数学公式环境"><a href="#数学公式环境" class="header-anchor">#</a> 数学公式环境</h2> <p><code>$ $</code>:行内数学模式</p> <p><code>$$ $$</code>或 <code>\[ \]</code>:行间数学公式</p> <p><code>\begin{equation}\label{key}\end{equation}</code>:带序号的数学公式</p> <p>矩阵环境：按快捷键 <code>ctrl + m</code>(前面自定义的)，启用矩阵向导来操作比较方便</p> <p>一组公式：一般使用array环境或align环境，加星号表示不标号，环境内 通过 <code>&amp;</code>对齐，通过 <code>\\</code>换行</p> <p><a href="https://blog.csdn.net/weixin_44378835/article/details/104201567" target="_blank" rel="noopener noreferrer">多行公式对齐<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><a href="https://blog.csdn.net/garfielder007/article/details/51646604" target="_blank" rel="noopener noreferrer">公式符号大全<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="插入图片"><a href="#插入图片" class="header-anchor">#</a> 插入图片</h2> <p>导入宏包：<code>\usepackage{graphicx}</code></p> <p>使用自定义的快捷键<kbd>ctrl+shift+i</kbd>启动插入图片向导</p> <p><img src="/assets/img/image-20200622172704129.01388878.png" alt="image-20200622172704129"></p> <p>这里长标题加了个下划线，这不是我想要的，因为latex会把下划线+字母解释成下标，后面我把下划线改成空格了</p> <p>请注意检查标题名是否出现了latex的特殊字符</p> <p><img src="/assets/img/image-20200622182304308.877b6124.png" alt="image-20200622182304308"></p> <p>生成的代码如下：</p> <div class="language-latex extra-class"><pre class="language-latex"><code><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">figure</span><span class="token punctuation">}</span>
	<span class="token function selector">\centering</span>
	<span class="token function selector">\includegraphics</span><span class="token punctuation">[</span>width=0.6<span class="token function selector">\linewidth</span><span class="token punctuation">]</span><span class="token punctuation">{</span>../baseline/pictures/trigger_model<span class="token punctuation">}</span>
	<span class="token function selector">\caption</span><span class="token punctuation">[</span>tm<span class="token punctuation">]</span><span class="token punctuation">{</span>trigger model<span class="token punctuation">}</span>
	<span class="token function selector">\label</span><span class="token punctuation">{</span><span class="token keyword">fig:triggermodel</span><span class="token punctuation">}</span>
<span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">figure</span><span class="token punctuation">}</span>
</code></pre></div><p><code>\centering</code>表示图片居中显示</p> <p><code>\caption</code>是图片的标题，如果这个东西在 <code>\includegraphics</code>上面，则标题生成在图片上方，反之在下方</p> <p><code>\label{fig:xxx}</code>用于交叉引用</p> <p>交叉引用图片的命令：<code>\ref{label名}</code>，会在引用处生成该图片的序号</p> <h2 id="插入表格"><a href="#插入表格" class="header-anchor">#</a> 插入表格</h2> <p>使用自定义快捷键 <code>ctrl+t</code>启用表格向导</p> <p><img src="/assets/img/image-20200622190226735.2c7610f1.png" alt="image-20200622190226735"></p> <p>这个向导生成的代码是酱紫的</p> <div class="language- extra-class"><pre class="language-text"><code>\begin{tabular}{|c|c|c|}
	\hline 
	a &amp; b &amp; c \\ 
	\hline 
	d &amp; e &amp; f \\ 
	\hline 
\end{tabular} 
</code></pre></div><p>连个table环境都不给我 = __=|||</p> <p>个人更喜欢直接敲代码模板生成三线表,效果如下</p> <p><img src="/assets/img/image-20200622191740143.94bd7c3a.png" alt="image-20200622191740143"></p> <p>首先导入宏包 ：<code>\usepackage{booktabs}</code>，代码如下</p> <div class="language-latex extra-class"><pre class="language-latex"><code><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span>
    <span class="token function selector">\centering</span>
    <span class="token function selector">\caption</span><span class="token punctuation">{</span><span class="token punctuation">}</span>
    <span class="token function selector">\label</span><span class="token punctuation">{</span><span class="token keyword">tab: </span><span class="token punctuation">}</span>
    <span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">tabular</span><span class="token punctuation">}</span><span class="token punctuation">{</span>cll<span class="token punctuation">}</span>
        <span class="token function selector">\toprule</span>
            <span class="token punctuation">&amp;</span>  <span class="token punctuation">&amp;</span>  <span class="token function selector">\\</span> 
        <span class="token function selector">\midrule</span>
        <span class="token punctuation">&amp;</span> <span class="token punctuation">&amp;</span>  <span class="token function selector">\\</span> 
        <span class="token function selector">\bottomrule</span>
    <span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">tabular</span><span class="token punctuation">}</span> 
<span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span>
</code></pre></div><p>与插入图片类似，<code>\centering</code>居中，<code>\caption</code>表格标题，<code>\label</code>用来交叉引用，引用方法依然是 <code>\ref{label name}</code></p> <p>`toprule<code>,</code>\midrule<code>, \</code>bottomrule`分别就是三线表的顶部、第二行，底部三条线，必须要导入booktabs宏包才能通过编译</p> <p>然后，把上面的代码手打一遍是很麻烦的，所以我编了一个宏，只需要在编辑时按快捷键 <code>shift+f1</code>即可生成上面的代码</p> <p><img src="/assets/img/image-20200622191715468.3274c17a.png" alt="image-20200622191715468"></p> <h2 id="设置中文显示"><a href="#设置中文显示" class="header-anchor">#</a> 设置中文显示</h2> <ol><li>编译器设置为XeLaTex</li> <li>导入ctex宏包：<code>\usepackage{ctex}</code></li></ol> <p>为了在tex文件中显示指定编码和编译器，可以在tex头部加入以下两行魔法注释</p> <div class="language-tex extra-class"><pre class="language-tex"><code><span class="token comment">% !Mode:: &quot;TeX:UTF-8&quot;</span>
<span class="token comment">% !TEX program  = xelatex</span>
</code></pre></div><h2 id="代码插入"><a href="#代码插入" class="header-anchor">#</a> 代码插入</h2> <p>对源代码进行高亮显示，使用lstings宏包 <code>\usepackage{listings}</code></p> <div class="language-tex extra-class"><pre class="language-tex"><code><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">lstlisting</span><span class="token punctuation">}</span><span class="token cdata">[language=python]
python code...
</span><span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">lstlisting</span><span class="token punctuation">}</span>
</code></pre></div><p>想要自定义高亮格式，使用xcolor宏包 <code>\usepackage{xcolor}</code>,并添加如下声明</p> <div class="language-latex extra-class"><pre class="language-latex"><code><span class="token function selector">\lstset</span><span class="token punctuation">{</span>
    <span class="token comment">%backgroundcolor=\color{red!50!green!50!blue!50},%代码块背景色为浅灰色</span>
    rulesepcolor= <span class="token function selector">\color</span><span class="token punctuation">{</span>gray<span class="token punctuation">}</span>, <span class="token comment">%代码块边框颜色</span>
    breaklines=true,  <span class="token comment">%代码过长则换行</span>
    numbers=left, <span class="token comment">%行号在左侧显示</span>
    numberstyle= <span class="token function selector">\small</span>,<span class="token comment">%行号字体</span>
    keywordstyle= <span class="token function selector">\color</span><span class="token punctuation">{</span>blue<span class="token punctuation">}</span>,<span class="token comment">%关键字颜色</span>
    commentstyle=<span class="token function selector">\color</span><span class="token punctuation">{</span>gray<span class="token punctuation">}</span>, <span class="token comment">%注释颜色</span>
    frame=shadowbox<span class="token comment">%用方框框住代码块</span>
    <span class="token punctuation">}</span>
</code></pre></div><p>效果如下：</p> <p><img src="/assets/img/image-20200622192943949.1ea472be.png" alt="image-20200622192943949"></p> <h2 id="辅助工具"><a href="#辅助工具" class="header-anchor">#</a> 辅助工具</h2> <p><a href="https://mathpix.com/" target="_blank" rel="noopener noreferrer">mathpix公式图片转latex<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><a href="http://latex.codecogs.com/eqneditor/editor.php" target="_blank" rel="noopener noreferrer">在线公式编辑器<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="资深玩家专区"><a href="#资深玩家专区" class="header-anchor">#</a> 资深玩家专区</h2> <p>以下的内容仅适合闲的蛋疼想自己制作排版格式的人，赶着写论文的人可以跳过此节。</p> <h3 id="设置字体与字号"><a href="#设置字体与字号" class="header-anchor">#</a> 设置字体与字号</h3> <p>（以后再说）</p> <p><a href="https://blog.csdn.net/weixin_44537194/article/details/87720878" target="_blank" rel="noopener noreferrer">字体设置<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><a href="https://blog.csdn.net/yq_forever/article/details/84023896?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&amp;depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase" target="_blank" rel="noopener noreferrer">修改字体字号大小<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h3 id="设置自定义命令"><a href="#设置自定义命令" class="header-anchor">#</a> 设置自定义命令</h3> <p><a href="https://blog.csdn.net/sdu_hao/article/details/101392629" target="_blank" rel="noopener noreferrer">LaTeX自定义命令和环境<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <div class="language-tex extra-class"><pre class="language-tex"><code><span class="token function selector">\newcommand</span>&lt;命令名称&gt;<span class="token punctuation">[</span>&lt;参数个数&gt;<span class="token punctuation">]</span><span class="token punctuation">[</span>&lt;首参数默认值&gt;<span class="token punctuation">]</span><span class="token punctuation">{</span>&lt;具体定义&gt;<span class="token punctuation">}</span>
<span class="token function selector">\renewcommand</span>&lt;命令名称&gt;<span class="token punctuation">[</span>&lt;参数个数&gt;<span class="token punctuation">]</span><span class="token punctuation">[</span>&lt;首参数默认值&gt;<span class="token punctuation">]</span><span class="token punctuation">{</span>&lt;具体定义&gt;<span class="token punctuation">}</span>
<span class="token function selector">\newenvironment</span><span class="token punctuation">{</span>&lt;环境名称&gt;<span class="token punctuation">}</span><span class="token punctuation">[</span>&lt;参数个数&gt;<span class="token punctuation">]</span><span class="token punctuation">[</span>&lt;首参数默认值&gt;<span class="token punctuation">]</span><span class="token punctuation">{</span>&lt;环境前定义&gt;<span class="token punctuation">}</span><span class="token punctuation">{</span>&lt;环境后定义&gt;<span class="token punctuation">}</span>
<span class="token function selector">\renewenvironment</span><span class="token punctuation">{</span>&lt;环境名称&gt;<span class="token punctuation">}</span><span class="token punctuation">[</span>&lt;参数个数&gt;<span class="token punctuation">]</span><span class="token punctuation">[</span>&lt;首参数默认值&gt;<span class="token punctuation">]</span><span class="token punctuation">{</span>&lt;环境前定义&gt;<span class="token punctuation">}</span><span class="token punctuation">{</span>&lt;环境后定义&gt;<span class="token punctuation">}</span>
</code></pre></div><h3 id="左对齐、右对齐、居中对齐"><a href="#左对齐、右对齐、居中对齐" class="header-anchor">#</a> 左对齐、右对齐、居中对齐</h3> <div class="language-tex extra-class"><pre class="language-tex"><code><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">flushleft</span><span class="token punctuation">}</span>
	left aligned
<span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">flushleft</span><span class="token punctuation">}</span>
<span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">flushright</span><span class="token punctuation">}</span>
	right aligned
<span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">flushright</span><span class="token punctuation">}</span>
<span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">center</span><span class="token punctuation">}</span>
	center aligned
<span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">center</span><span class="token punctuation">}</span>
</code></pre></div><p><img src="" alt="image-20200622140710500"></p> <h2 id="参考资料"><a href="#参考资料" class="header-anchor">#</a> 参考资料</h2> <p>https://blog.csdn.net/da_kao_la/article/details/83105948</p> <p>https://blog.csdn.net/yq_forever/article/details/84023896?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&amp;depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase</p> <p>https://blog.csdn.net/weixin_44378835/article/details/104201567</p> <p>https://blog.csdn.net/garfielder007/article/details/51646604</p></div> <footer class="page-edit"><!----> <!----> <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh"><img alt="知识共享许可协议" src="" style="border-width:0"></a><br>本作品采用<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">知识共享署名 4.0 国际许可协议</a>进行许可。

   
</footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/知识点总结/kotlin语法总结.html" class="prev">
        kotlin语法入门
      </a></span> <span class="next"><a href="/知识点总结/PS总结.html">
        PS总结
      </a>
      →
    </span></p></div>  <footer style="text-align:center;"><a href="https://beian.miit.gov.cn">
    粤ICP备2021020303号</a></footer></main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.54ea76a2.js" defer></script><script src="/assets/js/2.c554ece5.js" defer></script><script src="/assets/js/9.8def3992.js" defer></script>
  </body>
</html>
